package com.atguigu.spring.impl;

import com.atguigu.spring.annotation.AtguiguDoSth;
import com.atguigu.spring.api.SoldierService;
import org.springframework.stereotype.Component;

@Component
public class SoldierServiceImpl implements SoldierService {
    
    @Override
    @AtguiguDoSth(info = "原神 saveSoldier")
    public int saveSoldier(String soldierName) {
    
        System.out.println("核心业务逻辑：保存到数据库……");
    
        return 1;
    }
    
    @Override
    @AtguiguDoSth(info = "timi removeSoldier")
    public int removeSoldier(Integer soldierId) {
    
        System.out.println("核心业务逻辑：从数据库删除……");
    
        return 1;
    }
    
    @Override
    @AtguiguDoSth(info = "大富翁 updateSoldier")
    public int updateSoldier(Integer soldierId, String soldierName) {
    
        System.out.println("核心业务逻辑：更新……");
    
        return 1;
    }

    @Override
    @AtguiguDoSth(info = "泡泡龙 getSoldierNameById")
    public String getSoldierNameById(Integer soldierId) {
    
        System.out.println("核心业务逻辑：查询数据库……");
    
        return "good";
    }
}